﻿using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Windows.Printing;

namespace Apps.Maps
{
    public class Printer : MapToolsBase
    {
        private void PrintView()
        {
            PrintDocument print = new PrintDocument();
            print.PrintPage += (pd, pe) =>
            {
                Image img = new Image();
                img.Projection = new System.Windows.Media.PlaneProjection();
                (img.Projection as System.Windows.Media.PlaneProjection).RotationZ = 90;
                WriteableBitmap bitmap = new WriteableBitmap(ActiveMap, null);
              //  bitmap.r
                img.Source = bitmap;
                pe.PageVisual = img;

            };
            print.Print(null);
        }
        public override void Show()
        {
            this.PrintView();
        }
        public override void Close()
        {
            this.PrintView();
        }
    }
}
